package com.baizhi.object;

public class StudentDemo {
    public static void main(String[] args) throws Throwable {
        Student st = new Student();
        st.setName("张三");
        st.setAge(18);

        System.out.println(st);
        System.out.println(st.toString());


        Student st2 = new Student();
        st2.setName("李四");
        st2.setAge(19);
        System.out.println(st2);
        System.out.println(st2.toString());


        //告诉GC，st2是一个垃圾，需要你回收，但是不是调用这个方法之后，GC就会马上回收
        st2.finalize();
       // System.gc();

    }
}
